#ifndef PROPORTIONAL_ENV_HPP
#define PROPORTIONAL_ENV_HPP

#include "Environment.hpp"

/*!
 * \brief Functor class for scaling functions
 */
class ScalingFunction
{
public:
  virtual Gene operator()(const Gene &value)=0;
};


/*!
 * \brief Class for evolutionary optimisation using tournament selection
 */
class ProportionalEnv: public Environment
{
  void selection();
  //  Gene (*_scalingFunction)(const Gene&);
  ScalingFunction *_scalingFunction;
public:
  ProportionalEnv();
  //void setScalingFunction(Gene (*scalingFunction)(const Gene &));
  void setScalingFunction(ScalingFunction *scalingFunction);
  ~ProportionalEnv();
};

/*!
 * \brief Generic exponential scaling function
 */
class ExponentialScaling:public ScalingFunction
{
public:
  Gene operator()(const Gene & value){return exp(value);};
};

/*!
 * \brief Generic linear scaling function
 */
class LinearScaling:public ScalingFunction
{
  Gene _scale;
public:
  LinearScaling():_scale(10){};
  Gene operator()(const Gene & value){return _scale*value;};
  void setScale(const Gene &scale){_scale=scale;};
};


#endif
